# -*- coding: utf-8 -*-
from utils.operators.spark_submit import SparkSubmitOperator

from datetime import timedelta
from jms.dm.dm_transfor_center_package_detail import dm__dm_transfor_center_package_detail

dm__dm_transfor_center_package_rate = SparkSubmitOperator(
    task_id='dm__dm_transfor_center_package_rate',
    pool_slots=4,
    task_concurrency=1,  # 如果任务不支持并发，则将 task_concurrency 设为 1
    name='dm__dm_transfor_center_package_rate_{{ execution_date | date_add(1) | cst_ds }}',
    driver_memory='3G' , 
    executor_memory='2G' , 
    executor_cores=2 , 
    num_executors=2 , 
    email=['guoruiling@jtexpress.com','yl_bigdata@yl-scm.com'],
    conf={
        'spark.executor.memoryOverhead'             : '2048' , 
          'spark.core.connection.ack.wait.timeout': 5000,
          'spark.default.parallelism': 600,
          'spark.locality.wait': 60,
          'spark.driver.maxResultSize': 20,
          },
    java_class='com.yunlu.bigdata.jobs.export.ExportTransforCenterPackageRate',
    application='hdfs:///scheduler/jms/spark/zyt/transfor_center_package/TransforCenterPackage.jar',
    application_args=['{{ execution_date | cst_ds }}'],
    execution_timeout=timedelta(minutes=60),
)

dm__dm_transfor_center_package_rate << dm__dm_transfor_center_package_detail
